<?php
/**
 * 题库
 * User: cxm
 * Date: 2020/8/16
 * Time: 14:54
 */
namespace Seeds\Admin;

use App\Models\AdminPermission;
class QuestionSeeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public static function run()
    {
        // 一级
        $question = AdminPermission::create([
            'pid' => 0, 'sort' => 200, 'http_method' => ['GET'], 'name' => '题库管理', 'fid' => null, 'icon' => 'el-icon-notebook-1',
            'http_path' => 'javascript', 'menu_switch' => 2
        ]);

        /** ++++++++++++++++++++++++++++ 题库管理 start ++++++++++++++++++++++++++++++++++*/
        $index = AdminPermission::create([
            'pid' => $question->id, 'sort' => 10, 'http_method' => ['GET'], 'name' => '题库管理', 'fid' => null, 'icon' => 'ios-book',
            'url'=>'question_list','http_path' => 'javascript', 'menu_switch' => 2
        ]);

        // 列表
        AdminPermission::create([
            'pid' => $index->id, 'sort' => 10, 'http_method' => ['POST'], 'name' => '列表', 'fid' => null, 'icon' => 'ios-book',
            'url'=>'','http_path' => '/admin/question/lists', 'menu_switch' => 1
        ]);

        // 处理
        AdminPermission::create([
            'pid' => $index->id, 'sort' => 10, 'http_method' => ['POST'], 'name' => '添加、编辑处理', 'fid' => null, 'icon' => 'ios-book',
            'url'=>'','http_path' => '/admin/question/store', 'menu_switch' => 1
        ]);

        // 删除
        AdminPermission::create([
            'pid' => $index->id, 'sort' => 10, 'http_method' => ['POST'], 'name' => '删除', 'fid' => null, 'icon' => 'ios-book',
            'url'=>'','http_path' => '/admin/question/delete', 'menu_switch' => 1
        ]);

        // 排序
        AdminPermission::create([
            'pid' => $index->id, 'sort' => 10, 'http_method' => ['POST'], 'name' => '排序', 'fid' => null, 'icon' => '',
            'url'=>'','http_path' => '/admin/question/updateSort', 'menu_switch' => 1
        ]);

        // 显示隐藏
        AdminPermission::create([
            'pid' => $index->id, 'sort' => 10, 'http_method' => ['POST'], 'name' => '显示隐藏', 'fid' => null, 'icon' => '',
            'url'=>'','http_path' => '/admin/question/updateStatus', 'menu_switch' => 1
        ]);

        // 题导入
        AdminPermission::create([
            'pid' => $index->id, 'sort' => 10, 'http_method' => ['POST'], 'name' => '题导入', 'fid' => null, 'icon' => '',
            'url'=>'','http_path' => '/admin/question/import', 'menu_switch' => 1
        ]);

        // 查看处理的数据
        AdminPermission::create([
            'pid' => $index->id, 'sort' => 10, 'http_method' => ['POST'], 'name' => '查看处理的数据', 'fid' => null, 'icon' => '',
            'url'=>'','http_path' => '/admin/question/showData', 'menu_switch' => 1
        ]);

        // 删除结果
        AdminPermission::create([
            'pid' => $index->id, 'sort' => 10, 'http_method' => ['POST'], 'name' => '删除结果', 'fid' => null, 'icon' => '',
            'url'=>'','http_path' => '/admin/question/importRecordDelete', 'menu_switch' => 1
        ]);

        // 查看错误日志
        AdminPermission::create([
            'pid' => $index->id, 'sort' => 10, 'http_method' => ['POST'], 'name' => '查看错误日志', 'fid' => null, 'icon' => '',
            'url'=>'','http_path' => '/admin/question/showErrorLog', 'menu_switch' => 1
        ]);

        // 错误日志--excel导出
        AdminPermission::create([
            'pid' => $index->id, 'sort' => 10, 'http_method' => ['POST'], 'name' => '错误日志--excel导出', 'fid' => null, 'icon' => '',
            'url'=>'','http_path' => '/admin/question/showErrorLogExport', 'menu_switch' => 1
        ]);

        /** ++++++++++++++++++++++++++++ 题库管理 end ++++++++++++++++++++++++++++++++++*/

    }
}